<template>
  <swiper></swiper>
  <el-divider />
  <h2>通知公告</h2>
  <div class="table">
    <el-table :data="detail.list" border style="width: 100%">
      <el-table-column prop="id" v-if="false" />
      <el-table-column prop="title" label="标题" v-if="false" />
      <el-table-column prop="content" label="通知公告" width="900" />
      <el-table-column prop="noticeTime" label="发布时间" />
  </el-table> 
  </div>
  
  <el-pagination v-if="this.detail.total > 5" v-model:currentPage="detail.pageNum" v-model:page-size="detail.pageSize"
    :total="detail.total" :page-sizes="[5, 10]" :small="small" :background="background"
    layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
    @current-change="handleCurrentChange"></el-pagination>
    
</template>
<script>
import swiper from './container-swiper.vue'
export default {
  name: "notice",
  components: { swiper },
  data() {
    return {
      notice: {},
      detail:
      {
        list: [],
        total: 0,
        pageNum: null,
        pageSize: null,
      },
    }
  },
  methods: {
    tipone() {
      let _this = this;
      this.$axios({
        method: "post",
        url: "http://localhost:8080/nav/static/newstwo",
        // data:this.$qs.stringify(this.detail),
        data: this.$qs.stringify({
          pageSize: _this.detail.pageSize,
          pageNum: _this.detail.pageNum,
        }),
      }).then(res => {
        console.log(res.data);
        if (res.data.code == 1) {
          this.detail.list = res.data.data.list;
          this.detail.pageSize = res.data.data.pageSize;
          this.detail.pageNum = res.data.data.pageNum;
          this.detail.total = res.data.data.total;
        } else {
          console.log("error");
        }
      })
    }
  },
  mounted() {
    this.tipone();
  }

}
</script>

<style scoped>
h2 {
  font-family: 'Times New Roman', Times, serif;
  text-align: center;
}
.table{
  margin:10px;
}

</style>
